<template>
  <!--    <router-view />-->
  <keep-alive :include="cached">
    <router-view :key="$route.fullPath"/>
  </keep-alive>
</template>

<script>

export default {
  name: 'PageView',
  data () {
    return {
      cached: this.$store.state.catchArr
    }
  },
  watch: {
    $route: {
      // 监听路由变化
      handler: function (to, from) {
        this.cached = this.$store.state.catchArr
      }
    }
  }
}
</script>
